package com.ehotting.edsta.diagnosisPredict.feign;

import com.ehotting.eaf.core.web.domain.diagnosisPredict.Response;
import com.ehotting.edsta.diagnosisPredict.domain.dto.TrainingInfoDto;
import com.ehotting.edsta.diagnosisPredict.feign.factory.TraininginfoFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 模型任务训练feignClient
 */
@FeignClient(name = "modelManagerTraininginfo", url = "${request.url.prefix}/traininginfo",fallbackFactory = TraininginfoFallbackFactory.class)
public interface TraininginfoFeignService {

    /**
     * 创建保存模型信息
     * @param dto
     * @return
     */
    @PostMapping(value = "/training-info/create")
    Response<TrainingInfoDto> trainingInfoCreate(@RequestBody TrainingInfoDto dto);

    /**
     * 模型任务启动
     * @param id
     * @return
     */
    @PostMapping(value = "/training-info/{id}/startTask")
    Response<Boolean> startTask(@PathVariable("id") Long id);

    /**
     * 点击发布
     * @param projectId
     * @return
     */
    @GetMapping(value = "/training-info/getByProjectId")
    Response<TrainingInfoDto> getByProjectId(@RequestParam("projectId") Long projectId);

}